const fs = require('fs')
// const process = require('process')
const rds = fs.createWriteStream('./message.txt')
process.stdin.on('data', function (data) {
  rds.write(data)
})
process.stdin.on('end', function () {
  console.log('child process end');
  process.exit()
})